package cn.kgm.map;

import java.util.Map;

/**
 * Create by kappi on
 * 2021/12/7/007 16:06
 */
public class MapForeach {

    public static void main(String[] args) {
        mapLine();
    }

    private static void mapStream(Map<String,String> foreach){
        foreach.forEach((key,val)->{
            System.out.println(key+" "+val);
        });
    }

    private static void mapKeySet(Map<String,String> foreach){
        for (Map.Entry<String, String> key : foreach.entrySet()) {
            System.out.println(key+" "+foreach.get(key));

        }
    }

    private static void mapEntrySet(Map<String,String> foreach){
        for (String s : foreach.keySet()) {
            System.out.println(s+" "+foreach.get(s));
        }
    }

    private static void mapLine(){
        LineMap me = new LineMap();
        System.out.println(me.put("name", "张三").put("age",18).getLineMap());
    }

}
